package com.google.code.provadigital.dao.oracle;

import com.google.code.provadigital.daoo.InterfaceDAOAlternativa;
import com.google.code.provadigital.daoo.InterfaceDAOAluno;
import com.google.code.provadigital.daoo.InterfaceDAOFactory;
import com.google.code.provadigital.daoo.InterfaceDAOProfessor;
import com.google.code.provadigital.daoo.InterfaceDAOProva;
import com.google.code.provadigital.daoo.InterfaceDAOQuestao;

public class DAOSQOracleFactory implements InterfaceDAOFactory {

	private ConnectionFactoryOracle cfo;

	private InterfaceDAOAluno daoAluno;
	private InterfaceDAOProva daoProva;
	private InterfaceDAOAlternativa daoAlternativa;
	private InterfaceDAOProfessor daoProfessor;
	private InterfaceDAOQuestao daoQuestao;

	public DAOSQOracleFactory() {
		this.cfo = new ConnectionFactoryOracle();
	}

	@Override
	public InterfaceDAOAluno getDAOAluno() {
		if (this.daoAluno == null)
			this.daoAluno = new DAOAlunoOracle(this.cfo);
		return this.daoAluno;
	}

	@Override
	public InterfaceDAOProfessor getDAOProfessor() {
		if (this.daoProfessor == null)
			this.daoProfessor = new DAOProfessorOracle(this.cfo);
		return daoProfessor;
	}

	@Override
	public InterfaceDAOAlternativa getDAOAlternativa() {
		if (this.daoAlternativa == null)
			this.daoAlternativa = new DAOAlternativaOracle(this.cfo);
		return daoAlternativa;
	}

	@Override
	public InterfaceDAOQuestao getDAOQuestao() {
		if (this.daoQuestao == null)
			this.daoQuestao = new DAOQuestaoOracle(this.cfo);
		return daoQuestao;
	}

	@Override
	public InterfaceDAOProva getDAOProva() {
		if (this.daoProva == null)
			this.daoProva = new DAOProvaOracle(this.cfo);
		return daoProva;
	}

}
